/*
 * WllCompactCommand.h
 *
 *  Created on: 2016-1-1
 *      Author: wll
 */

#ifndef WLL_COMPACT_COMMAND_H_
#define WLL_COMPACT_COMMAND_H_

#include "WllInterpreter.h"
#include "Command.h"

class WllCompactCommand : public Command
{
public:
    WllCompactCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : Command(cmd, wllIntepreter) {}
};

class WllCompactCommandFactory : public CommandFactory
{
    virtual Command* CreateCommand(const Symbols& cmd, WllInterpreter* wllIntepreter);
};

class CompactLoadTranslationCommand : public WllCompactCommand
{
public:
    CompactLoadTranslationCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

class CompactClearTranslationCommand : public WllCompactCommand
{
public:
    CompactClearTranslationCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

class CompactAddTranslationCommand : public WllCompactCommand
{
public:
    CompactAddTranslationCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

class CompactCreateCompilerCommand : public WllCompactCommand
{
public:
    CompactCreateCompilerCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

class CompactTranslationCommand : public WllCompactCommand
{
public:
    CompactTranslationCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

class CompactRuleCommand : public WllCompactCommand
{
public:
    CompactRuleCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

class CompactVariableCommand : public WllCompactCommand
{
public:
    CompactVariableCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

class CompactConstantCommand : public WllCompactCommand
{
public:
    CompactConstantCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

class CompactRemarkCommand : public WllCompactCommand
{
public:
    CompactRemarkCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

class CompactEvalCommand : public WllCompactCommand
{
public:
    CompactEvalCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

class CompactExecCommand : public WllCompactCommand
{
public:
    CompactExecCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

class CompactIgnoreCommand : public WllCompactCommand
{
public:
    CompactIgnoreCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

class CompactCompactCommand : public WllCompactCommand
{
public:
    CompactCompactCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

class CompactListCommand : public WllCompactCommand
{
public:
    CompactListCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

//$APPEND(S_EXP_SYMBOL, S_EXP_SYMBOL) = S_EXP_SYMBOL
//($APPEND, (A,B), (C,D)) = (A, B, C, D)
class CompactAppendCommand : public WllCompactCommand
{
public:
    CompactAppendCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

//$CAR(ANY_SYMBOL) = S_EXP_SYMBOL|NIL
//($CAR, (A,B,C)) = A
class CompactCarCommand : public WllCompactCommand
{
public:
    CompactCarCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

//$CDR(ANY_SYMBOL) = S_EXP_SYMBOL|NIL
//($CDR, (A,B,C)) = (B, C)
class CompactCdrCommand : public WllCompactCommand
{
public:
    CompactCdrCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

//$COND(TRUE|FALSE,COMPACT|S_EXP,COMPACT|S_EXP)
//($COND, CONDITION, THEN, ELSE)
class CompactCondCommand : public WllCompactCommand
{
public:
    CompactCondCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

//$LOOP(COMPACT,COMPACT)
//($LOOP, CONDITION, REPEAT)
class CompactLoopCommand : public WllCompactCommand
{
public:
    CompactLoopCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

//$CALL(VARIABLE_SYMBOL,COMPACT_SYMBOL)
//($CALL, VARIABLE_SYMBOL, COMPACT_SYMBOL) => COMPACT_SYMBOL
class CompactCallCommand : public WllCompactCommand
{
public:
    CompactCallCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

//$FCALL(STRING_SYMBOL,VARIABLE_SYMBOL,COMPACT_SYMBOL)
//($FCALL, STRING_SYMBOL, VARIABLE_SYMBOL, COMPACT_SYMBOL) => COMPACT_SYMBOL
class CompactFCallCommand : public WllCompactCommand
{
public:
    CompactFCallCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

//$LREF(REFERENCE,STRING)
class CompactLRefCommand : public WllCompactCommand
{
public:
    CompactLRefCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

//$RREF(REFERENCE,STRING)
class CompactRRefCommand : public WllCompactCommand
{
public:
    CompactRRefCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

//$DEF(STRING, ANY_SYMBOL)
class CompactDefCommand : public WllCompactCommand
{
public:
    CompactDefCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

//$SET(STRING|REFERENCE, ANY_SYMBOL)
class CompactSetCommand : public WllCompactCommand
{
public:
    CompactSetCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

//$GET(STRING|REFERENCE, ANY_SYMBOL)
class CompactGetCommand : public WllCompactCommand
{
public:
    CompactGetCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

//$PUSHDATA()
//($PUSHDATA)
class CompactPushDataCommand : public WllCompactCommand
{
public:
    CompactPushDataCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

//$POPDATA()
//($POPDATA)
class CompactPopDataCommand : public WllCompactCommand
{
public:
    CompactPopDataCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

//$PUSH(ANY_SYMBOL)
class CompactPushCommand : public WllCompactCommand
{
public:
    CompactPushCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

//$POP(STRING_SYMBOL|REFERENCE)
class CompactPopCommand : public WllCompactCommand
{
public:
    CompactPopCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

//$ARRAY()
//($ARRAY)
class CompactArrayCommand : public WllCompactCommand
{
public:
    CompactArrayCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

//$MAP()
//($MAP)
class CompactMapCommand : public WllCompactCommand
{
public:
    CompactMapCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

//$CAST(REMARK_SYMBOL,SYMBOL)
class CompactSymbolCommand : public WllCompactCommand
{
public:
    CompactSymbolCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

//$CAST(REMARK_SYMBOL,SYMBOL)
class CompactCastCommand : public WllCompactCommand
{
public:
    CompactCastCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

//($ADD, SYMBOLS, SYMBOLS) = SYMBOLS + SYMBOLS
class CompactAddCommand : public WllCompactCommand
{
public:
    CompactAddCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

//($SUB, SYMBOLS, SYMBOLS) = SYMBOLS - SYMBOLS
class CompactSubCommand : public WllCompactCommand
{
public:
    CompactSubCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

//($MUL, SYMBOLS, SYMBOLS) = SYMBOLS * SYMBOLS
class CompactMulCommand : public WllCompactCommand
{
public:
    CompactMulCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

//($DIV, SYMBOLS, SYMBOLS) = SYMBOLS / SYMBOLS
class CompactDivCommand : public WllCompactCommand
{
public:
    CompactDivCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

//($EQ, CHAR_SYMBOL|INTEGER_SYMBOL|LONG_SYMBOL|FLOAT_SYMBOL|DOUBLE_SYMBOL|COMPACT_SYMBOL, SYMBOL)
class CompactEqCommand : public WllCompactCommand
{
public:
    CompactEqCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

class CompactSameCommand : public WllCompactCommand
{
public:
    CompactSameCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

//($LT, CHAR_SYMBOL|INTEGER_SYMBOL|LONG_SYMBOL|FLOAT_SYMBOL|DOUBLE_SYMBOL|COMPACT_SYMBOL, SYMBOL)
class CompactLtCommand : public WllCompactCommand
{
public:
    CompactLtCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

//$AND(TRUE|FALSE, TRUE|FALSE)
class CompactAndCommand : public WllCompactCommand
{
public:
    CompactAndCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

//$OR(TRUE|FALSE, TRUE|FALSE)
class CompactOrCommand : public WllCompactCommand
{
public:
    CompactOrCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

//$NOT(TRUE|FALSE, TRUE|FALSE)
class CompactNotCommand : public WllCompactCommand
{
public:
    CompactNotCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

//$SHELL(STRING_SYMBOL) => STRING_SYMBOL
class CompactShellCommand : public WllCompactCommand
{
public:
    CompactShellCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

//$CAT(STRING_SYMBOL) => STRING_SYMBOL
class CompactCatCommand : public WllCompactCommand
{
public:
    CompactCatCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

//$SUBSTR(STRING) => STRING
class CompactSubStrCommand : public WllCompactCommand
{
public:
    CompactSubStrCommand(const Symbols& cmd, WllInterpreter* wllIntepreter) : WllCompactCommand(cmd, wllIntepreter) {}
    virtual bool Interpret(std::vector<Symbols>& result);
};

#endif /* WLL_COMPACT_COMMAND_H_ */
